package com.zqs.controller;

import com.fasterxml.jackson.annotation.JsonAlias;
import com.zqs.entity.Brand;
import com.zqs.service.BrandService;
import com.zqs.utils.JsonResult;
import jdk.nashorn.internal.objects.annotations.Getter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 汽车品牌页
 */
@CrossOrigin
@RestController
@RequestMapping("brands")
public class BrandController extends BaseController{

    @Autowired
    private BrandService brandService;

    // 获取车品牌  不用传参
    @GetMapping("get_brand")
    public JsonResult<List<Brand>> getBrand(){
        List<Brand> datalist = brandService.showCarList();
        return new JsonResult<>(OK,datalist);
    }
}
